#include "algostuff.h"
using namespace std;

void move1()
{
	vector<string> coll1 = { "Hello", "this", "is", "an", "example" };
	list<string> coll2;

	// copy elements of coll1 into coll2
	copy(coll1.cbegin(), coll1.cend(), back_inserter(coll2));

	// print elements of coll2
	// use move() beacuse these elements in coll2 are not used again
	move(coll2.cbegin(), coll2.cend(), ostream_iterator<string>(cout, " "));
	cout << endl;

	// copy elements of coll1 into coll2 in reverse order
	// use move() because the elements in coll1 are not used again
	move(coll1.crbegin(), coll1.crend(), coll2.begin());

	// print elements of coll2 again
	// use move() because the elements in coll2 are not used again
	move(coll2.cbegin(), coll2.cend(), ostream_iterator<string>(cout, " "));
	cout << endl;
}